#include <stdio.h>

#include <string.h>

int main()

{

	char v[4][10], p[4], * t;

	int i, j;

	for (i = 0; i < 4; i++)

	{

		p[i] = v[i];

		scanf("%s", p[i]);

	}

	for (i = 0; i < 3; i++)

		for (j = i + 1; j < 4; j++)

			if (strcmp(p[i], p[j] > 0)
			{

				t = p[i];

				p[i] = p[j];

				p[j] = t;

			}

	for (i = 0; i < 4; i++)

		printf("%s ", p[i]);
	return 0;
}
